<!-- $Id: goods_search.htm 16790 2009-11-10 08:56:15Z wangleisvn $ -->
<script type="text/javascript" src="../plugins/autocomplete/jquery.autocomplete.js"></script>
<script type="text/javascript">	
	jQuery(function() {		
	
		jQuery("#cat_name").autocomplete({		
			url: '../plugins/autocomplete/search.php?type=cat',
			
			sortFunction: function(a, b, filter) {			
				var f = filter.toLowerCase();
				var fl = f.length;
				var a1 = a.value.toLowerCase().substring(0, fl) == f ? '0' : '1';
				var a1 = a1 + String(a.data[0]).toLowerCase();
				var b1 = b.value.toLowerCase().substring(0, fl) == f ? '0' : '1';
				var b1 = b1 + String(b.data[0]).toLowerCase();
				if (a1 > b1) {
					return 1;
				}
				if (a1 < b1) {
					return -1;
				}
				return 0;
			},
			showResult: function(value, data) {
				return '<span style="color:red">' + value + '</span>';
			},
			onItemSelect: function(item) {						
				jQuery("#cat_id").val(item.data);
			},
			maxItemsToShow: 50
		});
	
	
	});

</script>
<link rel="stylesheet" type="text/css" href="../plugins/autocomplete/jquery.autocomplete.css">	
<div class="form-div">
<fieldset class="theme_fieldset">
	<h2>注意：</h2>
	<li>未经翻译的产品不能成功发布到网站</li>
	<li>不可翻译数据，需要清除，点击清除不可翻译数据</li>
	<li>需要重新导出产品，请点击清空</li>
	<li>产品发布成功，请点击确认发布</li>
</fieldset>
  <form action="javascript:searchGoods()" name="searchForm">
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
    {if $smarty.get.act neq "trash"}
    <!-- 分类 -->
     <input name="cat_name" id="cat_name"  value="">
    <input id="cat_id" value="" type="hidden">
	
    <!-- 品牌 -->
    <select name="brand_id"><option value="0">{$lang.goods_brand}</option>{html_options options=$brand_list}</select>
     {if $suppliers_exists eq 1}    
      <!-- 供货商 -->
      <input name="suppliers_name" id="suppliers_name"  value="">
    <input id="suppliers_id" value="" type="hidden">
      {/if}
      <!-- 上架 -->
      <select name="is_on_sale"><option value=''>{$lang.intro_type}</option><option value="1">{$lang.on_sale}</option><option value="0">{$lang.not_on_sale}</option></select>
	  
	
    {/if}
	
	<!-- 语种 -->
    <select name="store" id="store"><option value="0">{$lang.lang_type}</option>{html_options options=$lang_set}</select>
	<!-- 翻译状态 -->
	<select name="is_trans"><option value='' selected="selected">全部</option><option value="1">已翻译</option><option value="0">未翻译</option>
    <!-- 关键字 -->
    {$lang.keyword} <input type="text" name="keyword" size="15" />
    <input type="submit" value="{$lang.button_search}" class="button" />
  </form>
</div>

{literal}
<script language="JavaScript">
    function searchGoods()
    {
{/literal}
        {if $smarty.get.act neq "trash"}
		listTable.filter['store'] = document.forms['searchForm'].elements['store'].value;  
		listTable.filter['is_trans'] = document.forms['searchForm'].elements['is_trans'].value;      
        listTable.filter['cat_id'] = document.forms['searchForm'].elements['cat_id'].value;
        listTable.filter['brand_id'] = document.forms['searchForm'].elements['brand_id'].value;
       
          {if $suppliers_exists eq 1}
          listTable.filter['suppliers_id'] = document.forms['searchForm'].elements['suppliers_id'].value;
          {/if}
        listTable.filter['is_on_sale'] = document.forms['searchForm'].elements['is_on_sale'].value;
		
        {/if}
{literal}
        listTable.filter['keyword'] = Utils.trim(document.forms['searchForm'].elements['keyword'].value);
        listTable.filter['page'] = 1;

        listTable.loadList();
    }
</script>
{/literal}

